package com.coscoleasing.prod.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ProductController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("prod")
    public Object test(){
    	logger.info("-----------------商品查询中----------------------!");
        ResponseEntity<String> mainOrderResponseEntity = restTemplate.getForEntity("http://localhost:8083/order", String.class);
        Object body = mainOrderResponseEntity.getBody();
        return body;
    }

}
